#ifndef MAVLINK_INTERFACE_H
#define MAVLINK_INTERFACE_H

#include "ip2366.h"
#include "fastmavlink_types.h"
#include "mavlink_msg_pl_fdb_info.h"
#include "mavlink_msg_pl_host_info.h"
#include "app.h"

typedef struct
{
    UART_HandleTypeDef *mavuart;
    uint8_t my_sysid;
    uint8_t my_compid;
    uint8_t host_info_flag;

    uint8_t uart_rx_buf[1];
    uint8_t rx_buf[296];
    uint8_t tx_buf[296];

    fmav_status_t status;
    fmav_message_t msg;
    fmav_result_t result;
    fmav_pl_host_info_t host_info;
    fmav_pl_fdb_info_t fdb_info;

} mavlink_interface_t;

void MavlinkData(mavlink_interface_t *mav, uint8_t c);
uint8_t sendFeedBackstatus(mavlink_interface_t *mav, ip2366_state_t *ip2366, system_state_t *sys);
void handleMessage(mavlink_interface_t *mav, fmav_message_t *msg);

#endif // !MAVLINK_INTERFACE_H
